package com.zb.springcloud.controller;

import com.zb.springcloud.entities.CommonResult;
import com.zb.springcloud.openfeign.OpenFegin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {
@Resource
OpenFegin openFegin;
            @GetMapping("/consumer/payment/get/{id}")
    CommonResult getPaymentById(@PathVariable("id") Long id){
      return   openFegin.getPaymentById(id);
    }

    @GetMapping("/consumer/feign/timeout")
    String getFeignTimeOut(){
        //客户端默认等待一秒钟
        return openFegin.getFeignTimeOut();
    };

}
